04 / 12

What is the controls attribute?

Understanding the controls Attribute

In HTML, the controls attribute is used with <video> and <audio> elements. It tells the browser to display built-in playback controls, such as play, pause, volume, and seek bar, so users can interact with the media.

Key Points about the controls Attribute
  1. 1

    It works with both <video> and <audio> elements.

  2. 2

    When present, it shows the browser’s default player interface (play/pause button, timeline, volume, etc.).

  3. 3

    It is a Boolean attribute — meaning you don’t need to assign it a value (just writing controls is enough).

  4. 4

    Without controls, the media can only be controlled through JavaScript or autoplay.

Example Usage

In short: The controls attribute makes media interactive by showing play, pause, volume, and other basic controls to the user.